notebook: Draw the same things, no matter the show-border value
authorBenjamin Otte <otte@redhat.com>
Sat, 19 Dec 2015 02:57:43 +0000 (03:57 +0100)
committerBenjamin Otte <otte@redhat.com>
Mon, 11 Jan 2016 16:05:22 +0000 (17:05 +0100)
show-border modifies the "frame" style class on the notebook node, but
not what we actually draw.

gtk/gtknotebook.c

index 1123a81eebc43b21606220ae136ab3ab04642266..ce05f75a68cfca312bf708685bb3cd911f6a10d0 100644 (file)
@@ -2307,52 +2307,49 @@ gtk_notebook_measure_contents (GtkCssGadget   *gadget,
         }
     }
 
-  if (priv->show_border || priv->show_tabs)
+  if (priv->show_tabs)
     {
-      if (priv->show_tabs)
-        {
-          GtkRequisition tabs_requisition = { 0, 0 };
+      GtkRequisition tabs_requisition = { 0, 0 };
 
-          gtk_notebook_get_preferred_tabs_size (notebook, &tabs_requisition);
-          if (orientation == GTK_ORIENTATION_HORIZONTAL)
+      gtk_notebook_get_preferred_tabs_size (notebook, &tabs_requisition);
+      if (orientation == GTK_ORIENTATION_HORIZONTAL)
+        {
+          if (priv->tab_pos == GTK_POS_TOP || priv->tab_pos == GTK_POS_BOTTOM)
             {
-              if (priv->tab_pos == GTK_POS_TOP || priv->tab_pos == GTK_POS_BOTTOM)
-                {
-                  *minimum = MAX (*minimum, tabs_requisition.width);
-                  *natural = MAX (*minimum, *natural);
-                }
-              else
-                {
-                  *minimum += tabs_requisition.width;
-                  *natural += tabs_requisition.width;
-                }
+              *minimum = MAX (*minimum, tabs_requisition.width);
+              *natural = MAX (*minimum, *natural);
             }
           else
             {
-              if (priv->tab_pos == GTK_POS_LEFT || priv->tab_pos == GTK_POS_RIGHT)
-                {
-                  *minimum = MAX (*minimum, tabs_requisition.height);
-                  *natural = MAX (*minimum, *natural);
-                }
-              else
-                {
-                  *minimum += tabs_requisition.height;
-                  *natural += tabs_requisition.height;
-                }
+              *minimum += tabs_requisition.width;
+              *natural += tabs_requisition.width;
             }
         }
       else
         {
-          for (children = priv->children; children;
-               children = children->next)
+          if (priv->tab_pos == GTK_POS_LEFT || priv->tab_pos == GTK_POS_RIGHT)
             {
-              page = children->data;
-
-              if (page->tab_label && gtk_widget_get_visible (page->tab_label))
-                gtk_widget_hide (page->tab_label);
+              *minimum = MAX (*minimum, tabs_requisition.height);
+              *natural = MAX (*minimum, *natural);
+            }
+          else
+            {
+              *minimum += tabs_requisition.height;
+              *natural += tabs_requisition.height;
             }
         }
     }
+  else
+    {
+      for (children = priv->children; children;
+           children = children->next)
+        {
+          page = children->data;
+
+          if (page->tab_label && gtk_widget_get_visible (page->tab_label))
+            gtk_widget_hide (page->tab_label);
+        }
+    }
 
   border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
 
@@ -2478,7 +2475,7 @@ gtk_notebook_allocate_contents (GtkCssGadget        *gadget,
       child_allocation.width = MAX (1, allocation->width - border_width * 2);
       child_allocation.height = MAX (1, allocation->height - border_width * 2);
 
-      if (priv->show_tabs || priv->show_border)
+      if (priv->show_tabs)
         {
           if (priv->show_tabs && priv->children && priv->cur_page)
             {
@@ -5386,8 +5383,7 @@ gtk_notebook_paint (GtkWidget    *widget,
   context = gtk_widget_get_style_context (widget);
   showarrow = FALSE;
 
-  if ((!priv->show_tabs && !priv->show_border) ||
-      !priv->cur_page || !gtk_widget_get_visible (priv->cur_page->child))
+  if (!priv->cur_page || !gtk_widget_get_visible (priv->cur_page->child))
     return;
 
   x += border_width;